package com.tinycloud.miracll.product.service.impl;

import java.util.Date;
import java.util.List;

import com.tinycloud.common.datasource.annotation.Slave1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tinycloud.miracll.product.mapper.ProductScheduleDetailMapper;
import com.tinycloud.miracll.product.domain.ProductScheduleDetail;
import com.tinycloud.miracll.product.service.IProductScheduleDetailService;

/**
 * 排产明细Service业务层处理
 * 
 * @author tiny
 * @date 2022-05-28
 */
@Service
@Slave1
public class ProductScheduleDetailServiceImpl implements IProductScheduleDetailService {
    @Autowired
    private ProductScheduleDetailMapper productScheduleDetailMapper;

    /**
     * 查询排产明细
     * 
     * @param scheduleDate 排产明细主键
     * @return 排产明细
     */
    @Override
    public ProductScheduleDetail selectProductScheduleDetailByScheduleDate(Date scheduleDate) {
        return productScheduleDetailMapper.selectProductScheduleDetailByScheduleDate(scheduleDate);
    }

    /**
     * 查询排产明细列表
     * 
     * @param productScheduleDetail 排产明细
     * @return 排产明细
     */
    @Override
    public List<ProductScheduleDetail> selectProductScheduleDetailList(ProductScheduleDetail productScheduleDetail) {
        return productScheduleDetailMapper.selectProductScheduleDetailList(productScheduleDetail);
    }

    /**
     * 新增排产明细
     * 
     * @param productScheduleDetail 排产明细
     * @return 结果
     */
    @Override
    public int insertProductScheduleDetail(ProductScheduleDetail productScheduleDetail) {
        return productScheduleDetailMapper.insertProductScheduleDetail(productScheduleDetail);
    }

    /**
     * 修改排产明细
     * 
     * @param productScheduleDetail 排产明细
     * @return 结果
     */
    @Override
    public int updateProductScheduleDetail(ProductScheduleDetail productScheduleDetail) {
        return productScheduleDetailMapper.updateProductScheduleDetail(productScheduleDetail);
    }

    /**
     * 批量删除排产明细
     * 
     * @param scheduleDates 需要删除的排产明细主键
     * @return 结果
     */
    @Override
    public int deleteProductScheduleDetailByScheduleDates(Date[] scheduleDates) {
        return productScheduleDetailMapper.deleteProductScheduleDetailByScheduleDates(scheduleDates);
    }

    /**
     * 删除排产明细信息
     * 
     * @param scheduleDate 排产明细主键
     * @return 结果
     */
    @Override
    public int deleteProductScheduleDetailByScheduleDate(Date scheduleDate) {
        return productScheduleDetailMapper.deleteProductScheduleDetailByScheduleDate(scheduleDate);
    }
}
